package com.develop.wechatpay.service;

import com.alibaba.fastjson.JSONObject;
import com.develop.wechatpay.domain.WechatPayModel;
import com.wechat.pay.contrib.apache.httpclient.auth.Verifier;
import com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager;
import org.apache.http.impl.client.CloseableHttpClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.parsers.ParserConfigurationException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SignatureException;
import java.util.HashMap;
import java.util.Map;

public interface WeChatPayOrderService {

    JSONObject jsapiAddOrder(WechatPayModel wechatPayModel) throws Exception;

    JSONObject getNativeNotify(HttpServletRequest request, HttpServletResponse response);

    String getWSNativeNotify(HttpServletRequest request, HttpServletResponse response) throws ParserConfigurationException;

    JSONObject queryOrderByOutRradeNo(String outRradeNo) throws Exception;

    JSONObject queryOrderByTransactionId(String transactionId) throws IOException;

    JSONObject closeOrderByOutRradeNo(String outRradeNo) throws IOException;

    String getPaySign(String timestamp, String nonceStr, String prepay_id) throws NoSuchAlgorithmException, FileNotFoundException, SignatureException, InvalidKeyException, UnsupportedEncodingException;

    JSONObject getTradeBillFile(String bill_date, String bill_type, String tar_type) throws IOException;

    JSONObject getFundFlowBillFile(String bill_date, String account_type, String tar_type) throws IOException;
}
